package com.ruoyi.welcome.controller;

import com.ruoyi.common.core.controller.BaseController;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.welcome.service.DocWelContractNumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/welcome/contract")
public class DocWelContractNumController extends BaseController {
    @Autowired
    private DocWelContractNumService docWelContractNumService;

    /**
     * 获取状态为1的合同数量
     * @return 统计结果
     */
    @GetMapping("/count/state1")
    public AjaxResult getContractCountByState1() {
        // 调用Service层获取统计数据
        Integer count = docWelContractNumService.getContractCountByState1();
        // 使用Ruoyi框架统一响应格式返回结果
        return AjaxResult.success(count);
    }
}
